<%@ page language="java"
	import="java.util.*,com.icss.ah.base.util.ResourceLoader"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String proDesc = ResourceLoader.getInstance("icss").getString("proDesc");
%>

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description" />
<meta content="B2B电商平台" name="keyword" />

<title>B2B电商平台.店铺商品类型维护</title>
<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
<link rel="shortcut icon" href="include/images/icss.ico"
	type="image/x-icon" />
<link rel="stylesheet"
	href="<%=path%>/include/JQuery zTree v3.4/css/demo.css">
<link rel="stylesheet"
	href="<%=path%>/include/JQuery zTree v3.4/css/zTreeStyle/zTreeStyle.css">
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/global.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/style.css" />

<script type="text/javascript"
	src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/js/icss.shop.manage.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/JQuery zTree v3.4/js/jquery.ztree.core-3.4.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/JQuery zTree v3.4/js/jquery.ztree.excheck-3.4.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.busin.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/js/icss.common.js"></script>

<style type="text/css">
body {
	font-size: 14px;
	padding: 0px;
}

.title_div {
	height: 81px;
	padding-top: 20px;
	text-align: center; //
	border-bottom: 3px solid #e0e0e0;
	background: #fff;
}

.titleCss {
	height: 65px;
	width: 790px;
	margin: 0 auto;
	background: url('<%=path %>/images/postTrade/post_trade_one.png')
		no-repeat 0 0;
}

.title_2 {
	background-position: 0 -200px;
}

.mainDiv {
	margin: 10px auto;
}

.nextDiv button {
	font: 20px "Microsoft YaHei", "SimHei ";
	line-height: 63px;
	width: 203px;
	background: url('<%=path %>/images/postTrade/pic-global.png') no-repeat
		-148px -558px;
	color: #fff;
}

.subDiv {
	text-align: center;
	padding: 60px 0px;
	background: #fff;
}

.nextDiv {
	height: 100%;
	margin: 0px auto;
}

.main_div1 {
	background: #fff;
	height: 48px;
	margin: 10px 0px;
	border-top: 4px solid #F75D5F;
	line-height: 48px;
	padding: 0px 10px;
}

.btCss {
	height: 22px;
	width: 60px;
	background: url('<%=path %>/images/postTrade/abtnBg.png');
	float: left;
	margin: 13px 0 0 20px;
	font-size: 12px;
	line-height: 22px;
	padding-left: 20px;
	margin-left: 20px;
}

a {
	color: #039;
	text-decoration: none
}

ul, li {
	list-style: none;
}

.main_div1 li {
	float: left;
	font-size: 12px;
}

.saveDraftCss {
	float: right;
	border: 1px solid #cfcfcf;
	color: #333;
	line-height: 28px;
	margin: 10px 0px;
	padding: 0px 20px;
}

.saveDraftCss:hover {
	background: #ff8048;
	color: #fff;
	border: 1px solid #f67943;
}

.getDraftCss:hover {
	color: red;
}

.divCss_title {
	background: #fff;
	height: 40px;
	font: 18px/40px "Microsoft YaHei", "SimHei ";
	text-indent: 10px;
	border-bottom: 1px solid #d1d1d1;
	color: #000;
}

.tipH4 {
	width: 80px;
	float: left;
	font-weight: bold;
	line-height: 18px;
}

.cdyParaCss ul {
	width: 280px;
	border: 1px solid #c7c7c7;
	height: 22px;
}

.cdyParaCss ul li {
	display: none;
}

.cdyParaCss .tdL {
	text-align: right;
	width: 152px;
}

.cdyParaCss .tdR {
	text-align: left;
	padding-left: 10px;
	vertical-align: middle;
}

.cdyParaCss .tdR div {
	width: 280px;
	border: 1px solid #c7c7c7;
	height: 22px;
}

.cdyParaCss .tdR input {
	border: 0px;
	padding: 0px 3px;
	margin-top: -15px;
	width: 250px;
}

.cdyParaCss .tdR s, td div s, .addPrice_css {
	float: right;
	width: 21px;
	height: 22px;
	background: url('<%=path %>/images/postTrade/pic-global.png') no-repeat
		-275px -275px;
}

.cdyParaCss .tdR select {
	appearance: none;
	-moz-appearance: none;
	-webkit-appearance: none;
	width: 282px;
	margin: 20px 0 0 -257px;
	position: absolute;
	overflow: auto;
	max-height: 200px;
}

.cdyParaCss .tdR select option {
	heigth: 20px;
	padding: 5px 3px 0px;
}

.cdyParaCss .tdR select option:hover {
	background: #ebebeb;
}

.borderCss {
	border-top: 1px dashed #ccc;
	margin: 20px 80px;
	padding-bottom: 5px;
}

.div_title_css {
	border: 0px;
	margin: 15px 0px 10px 80px;;
	white-space: nowrap;
}

.div_title_css table tr td {
	width: 16%;
}

.div_title_css table tr td input {
	width: 90%;
	height: 22px;
}

.div_title_css p {
	color: #999;
	padding: 10px 0px 10px 83px;
	white-space: normal;
}

.radioCss {
	margin: 0px;
}

.line_color_css td {
	border-top: 1px solid #c7c7c7;
}

.td1 {
	width: 130px;
	text-align: right;
	padding-right: 10px;
}

.addPrice_css {
	height: 11px;
	background-position: -478px -298px;
	margin-top: 11px;
	margin-left: 5px;
	float: left;
}

.img_css {
	padding-right: 10%;
	float: left;
	width: 14%;
	margin-top: 20px;
}

.add_img_div {
	height: 102px;
	width: 102px;
	background: url('<%=path %>/images/postTrade/addIco.png') no-repeat 0px
		-50px;
}

td {
	vertical-align: middle;
}
</style>

<script type="text/javascript">
	   $(document).mousedown(function (e) {  
         	var className = $(e.target).attr("class");
         	if(className!='selectI'&&className!='selectS'&&className!='selectO'&&className!='selType'){
         		$(".checkSelect").hide();
         		_clickInput('1');
         	}
     	}); 

		function _goBackPage(){//返回上一页
			window.location.href = "<%=path %>/productPublish/toProductPublishOnePage.do";
		}
		function _getDraftListPage(){//草稿列表页
			window.location.href = "<%=path %>/productPublish/toProductPublishOnePage.do";
		}
		function _saveDraftInfo(){//草稿列表页
			window.location.href = "<%=path %>/productPublish/toProductPublishOnePage.do";
		}
		function _selVal(para){//商品参数项搜索
			$("#sel0").css("display","");
			$("#sel0").size(6);
			$(".att0").css("border","1px solid #86b4f8");
			$(".att0 s").css("background-position", "-275px -308px");
		}
		var paraNum = 0;

		function _pullList(num,viewCode){//select下拉列表
			var codeName = $("#codeName").val();
			$.ajax({
				type:"post",
				url:'<%=path%>/productPublish/queryDirectoryInfo.do',
				dataType:"json",
				//async:true,
				data:{viewCode:viewCode,codeName:codeName,flag:"1"},
				success:function(data){
					if(data){
						//$("#sel"+num).remove();
						var arr = data.directoryList;
						var html = "";
						if(arr.length==1)
							html += "<select id='sel"+num+"' size='"+arr.length+"' class='att"+(num+1)+" checkSelect' style='display:none;overflow: hidden;margin-top: 22px;'>";
						else
							html += "<select id='sel"+num+"' size='"+arr.length+"' class='att"+num+" checkSelect' style='display:none;margin-top: 22px;'>";
						for(var i=0;i<arr.length;i++){
							var d = arr[i];
							html += "<option onclick=\"_clickOption('att"+num+"','"+d.CODE_NAME+"')\" class='selectO' value='"+d.CODE_NAME+"'>"+d.CODE_NAME+"</option>";
						}
						html += "</select>";
						$("#att"+num).after(html);
					}
				}
			});
		}

		
		function _clickInput(id){
			$("select[class!=selType]").css("display","none");
			$("select").parent("div").css("border","1px solid #c7c7c7");
			$("select").next("s").css("background-position", "-275px -275px");
			$("."+id).css("display","");
			$("."+id).css("border","1px solid #86b4f8");
			$("."+id+" s").css("background-position", "-275px -308px");
		}

		function _clickOption(id,val){
			$("#"+id).val(val);
			$("."+id).css("border","1px solid #c7c7c7");
			$("."+id+" s").css("background-position", "-275px -275px");
			id = id.replace("att","");
			$("#sel"+id).css("display","none");
			if(id=="measuring"){
				 $(".unitVal").empty();
				 $(".unitVal").text(val);
			}
		}
		function _clickOptionProType(id ,id2,val,valName) {
			$("#"+id).val(val);
			$("#"+id2).val(valName);
			$("."+id2).css("border","1px solid #c7c7c7");
			$("."+id2+" s").css("background-position", "-275px -275px");
			id = id.replace("att","");
			$("#sel"+id).css("display","none");
			$("#sel"+id2).css("display","none");
			if(id=="measuring"){
				 $(".unitVal").empty();
				 $(".unitVal").text(valName);
			}
		}

		function _clickOptionNew(id,val,valName){
			$("#"+id).val(valName);
			$("#"+id+"New").val(val+"#@"+valName);
			$("."+id).css("border","1px solid #c7c7c7");
			$("."+id+" s").css("background-position", "-275px -275px");
			id = id.replace("att","");
			$("#sel"+id).css("display","none");
			if(id=="measuring"){
				 $(".unitVal").empty();
				 $(".unitVal").text(valName);
			}
		}
		
		function _measuringInfo(itemCode){//计量单位 flag: 2
			$.ajax({
				type:"post",
				url:'<%=path%>/productPublish/queryUnitInfo.do',
				dataType:"json",
				data:{itemCode:itemCode},
				success:function(data){
					if(data){
						var arr = data.directoryList;
						var size = arr.length;
						var overFlow = "hidden";
						if(arr.length>10){
							size = 10;
							overFlow = "auto";
						}
						
						var html = "<br><select id='selmeasuring' size='"+size+"' class='measuring' style='display:none;overflow:"+overFlow+";margin:-18px 0px 0px -1px;position: absolute;width:173px;'>";
						//if(arr.length==1)
						//else
						//	html += "<select id='selmeasuring' size='"+arr.length+"' class='measuring' style='margin:22px 0px 0px -150px;position: absolute;width:172px;'>";
						for(var i=0;i<arr.length;i++){
							var d = arr[i];
							html += "<option onclick=\"_clickOptionNew('measuring','"+d.UNIT_CODE+"','"+d.UNIT_NAME+"')\" class='selectO' value='"+d.UNIT_CODE+"'>"+d.UNIT_NAME+"</option>";
						}
						html += "</select>";
						$(".measuring").append(html);
						_reHeight("rightFrame","contentDiv");
					}
				}
			});
		}
		
		function _save(){
			/*var measuring = $("#measuring").val();
    		if(measuring==null||measuring==""){
    			alert("请选择商品计量单位");
        		return;
    		}
    		_vfnPrice();
    		if(vPrice==1){
        		alert("价格区间不完善");
        		return;
    		}
    		
    		var proStock = $("#proStock").val();
    		if(proStock==null||proStock==""){
    			alert("请维护供应量");
        		return;
    		}*/
    		var proPrice = $("#proPrice").val();
    		if(proPrice==null||proPrice==""){
    			alert("请维护成本价格");
        		return;
    		}
    		var price = $("#price").val();
    		if(price==null||price==""){
    			alert("请维护零售价格");
        		return;
    		}
    		
			var unitWeight = $("#unitWeight").val();
    		if(unitWeight==null||unitWeight==""){
    			alert("请维护商品单位重量");
        		return;
    		}
    		var dataStr = {};
 		    var dataArr = $("input").serializeArray();
 		    for (var i = 0; i < dataArr.length; i++) {
 		        dataStr[dataArr[i].name] = dataArr[i].value;
 		    }
 		    dataStr["templateId"]=$("#templateId").val();// 运费模板
    		$.ajax({
 	 		    type:"post",
 	 		    url:"<%=path%>/productPublish/saveFour.do",
 	 		    data:dataStr,
 	 		  	dataType:"json",
 	 		    success:function(data){
 	 		    	console.info(data);
 	 	 		    var flag = data.saveFlag;
 	 	 		    var productId = data.productId;
 	 	 		    if(flag=="1"){
 	 	 	 		    window.location.href="<%=path %>/productPublish/toProductPublishFivePage.do?productId="+productId;
 	 	 	 		}else{
 	 	 	 			alert("输入数据不规范，请检查后再保存");
 	 	 	 		}
 	 	 		}
 	 		});
    	}


  	</script>
</head>

<body>
	<div id="contentDiv">
		<div style="background: #ebebeb;">
			<input type="hidden" id="itemCode" name="itemCode"
				value="${itemCode }"> <input type="hidden" id="productId"
				name=productId value="${productId }"> <input type="hidden"
				id="codeName" name="codeName"> <input type="hidden"
				id="shopId" name="shopId">
			<div class="title_div">
				<div class="titleCss title_2"></div>
				<hr color="#ebebeb" height="0.1px"
					style="margin-top: 13px; display: none;" />
			</div>
			<div class="main_div1">
				<p style="float: left; white-space: nowrap;">
					<strong>您选择的类目：</strong>${itemName } <a style="margin-left: 10px"
						href="#" onclick="_goBackPage()">修改</a>
				</p>
				<a href="#" class="btCss" style="display: none;">纠错/建议</a>
				<ul style="float: right; display: none;">
					<li style="width: 190px; line-height: 48px;"><a href="#"
						onclick="_getDraftListPage()" class="getDraftCss">查看草稿箱</a> <a
						class="saveDraftCss" href="#" onclick="_saveDraftInfo()">保存草稿</a>
					</li>
				</ul>
			</div>
			<div style="background: #fff; font-size: 12px; padding-bottom: 15px;">
				<div class="divCss_title">商品交易信息</div>
				<div style="padding: 20px 0px 0px 23px;">
					<table style="width: 100%; line-height: 40px;">
						<tr style="display: none;">
							<td class="td1">是否支持网上交易：</td>
							<td><lable> <input type="radio" name="onlineTrading"
									class="radioCss" /> 支持</lable> <lable style="padding-left:20px;">
								<input type="radio" name="onlineTrading" class="radioCss" />
								不支持</lable> <span style="white-space: nowrap; padding-left: 30px;">
									发布支持网上交易商品，您需要提交经营资质备案。<a href="#">立即备案</a>&nbsp;&nbsp;<a
									href="#">备案教程</a>
							</span></td>
						</tr>
						<tr>
							<td class="td1">计量单位：</td>
							<td style="vertical-align: middle;">${pro.proUnitName }
								<div class="measuring"
									style="float: left; border: 1px solid #c7c7c7; height: 22px; display: none;">
									<input onclick="_clickInput('measuring')"
										style="height: 19px; border: 0px; padding-left: 3px; margin-top: -21px;"
										id="measuring" name="measuring" placeholder="请选择计量单位" /> <input
										type='hidden' value="${pro.proUnitCode }#@${pro.proUnitName }"
										id="measuringNew" name="measuringNew" placeholder="请选择计量单位" />
									<s onclick="_clickInput('measuring')" class="selectS"> </s>
								</div>
							</td>
						</tr>
						<tr style="display: none;">
							<td class="td1">报价方式：</td>
							<td><lable> <input type="radio" name="priceWay"
									class="radioCss" /> 电话报价</lable> <lable style="padding-left:20px;">
								<input type="radio" name="priceWay" class="radioCss" /> 直接报价</lable></td>
						</tr>
						<tr>
							<td class="td1" style="">零售价：</td>
							<td><input id="price" name="price"
								onBlur="_checkNum('1',this)"
								style="border: 1px solid #c7c7c7; height: 22px; width: 188px;" />&nbsp;元&nbsp;
								<!-- 
	   							<table class="line_color_css" style="width: 50%;line-height: 34px;border: 1px solid #c7c7c7;border-top: 0px;float: left; margin-right: 5%;">
		   							<tr style="text-align: center;">
		   								<td style="width:55%"><em style="color:#f00;">*</em>&nbsp;采购数量</td>
		   								<td style="text-align: left;"><em style="color:#f00;">*</em>&nbsp;商品单价</td>
		   							</tr>
		   							<tr>
		   								<td>&nbsp;起批量<input id="buyNum0" name="buyNum0" style="width: 70px;height: 22px;" onblur="_previewHtml('0','-1')"/>以上：</td>
		   								<td><input id="price0" name="price0" style="width: 70px;height: 22px;" onblur="_previewHtml('0','-1')"/> 元/<span class="unitVal">个</span></td>
		   							</tr>
		   							<tr id="p0" class="tr1" style="display: none;border: 0px;text-align: center;">
		   								<td style="border: 0px;color: #f00">
		   									<em id="p01" class="tr1" style="display: none;">采购数量必须大于前者</em>
		   									<em id="t01" style="display: none;">请输入采购数量</em>
		   								</td>
		   								<td style="border: 0px;color: #f00;text-align: left;">
		   									<em id="p02" class="tr1" style="display: none;">商品单价必需小于前者</em>
		   									<em id="t02" class="tr1" style="display: none;">请输入商品单价</em>
		   								</td>
		   							</tr>
		   							<tr id="tr1" style="display: none;">
		   								<td>&nbsp;购&nbsp;买<input id="buyNum1" name="buyNum1" style="width: 70px;height: 22px;"  onblur="_onbl('buyNum1','1','buyNum0')"/>以上：</td>
		   								<td><input id="price1" name="price1" style="width: 70px;height: 22px;" onblur="_onbl('price1','2','price0')"/> 元/<span class="unitVal"></span> <em style="color: #f00" onclick="_delTr('tr1')">删除</em></td>
		   							</tr>
		   							<tr id="p1" class="tr1" style="display: none;border: 0px;text-align: center;">
		   								<td style="border: 0px;color: #f00">
		   									<em id="p11" class="tr1" style="display: none;">采购数量必须大于前者</em>
		   									<em id="t11" style="display: none;">请输入采购数量</em>
		   								</td>
		   								<td style="border: 0px;color: #f00;text-align: left;">
		   									<em id="p12" class="tr1" style="display: none;">商品单价必需小于前者</em>
		   									<em id="t12" class="tr1" style="display: none;">请输入商品单价</em>
		   								</td>
		   							</tr>
		   							<tr id="tr2" style="display: none;">
		   								<td>&nbsp;购&nbsp;买<input id="buyNum2" name="buyNum2" style="width: 70px;height: 22px;" onblur="_onbl('buyNum2','1','buyNum1')"/>以上：
		   								</td>
		   								<td><input id="price2" name="price2" style="width: 70px;height: 22px;" onblur="_onbl('price2','2','price1')"/> 元/<span class="unitVal"></span> <em style="color: #f00" onclick="_delTr('tr2')">删除</em></td>
		   							</tr>
		   							<tr id="p2" class="tr2" style="display: none;border: 0px;text-align: center;">
		   								<td style="border: 0px;color: #f00">
		   									<em id="p21" class="tr2" style="display: none;">采购数量必须大于前者</em>
		   									<em id="t21" class="tr2" style="display: none;">请输入采购数量</em>
		   								</td>
		   								<td style="border: 0px;color: #f00;text-align: left;">
		   									<em id="p22" class="tr2" style="display: none;">商品单价必需小于前者</em>
		   									<em id="t22" class="tr2" style="display: none;">请输入商品单价</em>
		   								</td>
		   							</tr>
		   							<tr id="addPrice">
				   						<td colspan="2">
				   							<s class="addPrice_css"> </s>
				   							<em style="color: #039" onclick="_addPrice()">增加价格区间</em>
				   						</td>
				   					</tr>
		   						</table>
		   						<table style="width: 40%;border: 1px solid #c7c7c7;">
		   							<tr>
		   								<td style="width: 50px;background: #ebebeb;text-align: center;height: 105px;vertical-align: middle;"><span style="">预<br/>览</span></td>
		   								<td style="text-align: center;vertical-align: middle;">
		   									<table id="preview" style="width: 100%;height: 105px;padding: 0 8px;color: #999">
		   										<tr id="yl"><td colspan="2"><span style="color: #999">可根据买家采购数量的不同设置不同价格</span></td></tr>
		   										<tr id="preview0" style="display: none;">
		   											<td style="width: 40%;text-align: left;"><span id="preview01" ></span></td>
		   											<td><span id="preview02" ></span><span class="unitVal"></span></td>
		   										</tr>
		   										<tr id="preview1" style="display: none;">
		   											<td style="border-top: 1px dotted #c7c7c7;text-align: left;">
		   												<span id="preview11" ></span>
		   											</td>
		   											<td style="border-top: 1px dotted #c7c7c7">
		   												<span id="preview12" ></span><span class="unitVal"></span>
		   											</td>
		   											</tr>
		   										<tr id="preview2" style="display: none;">
		   											<td style="border-top: 1px dotted #c7c7c7;text-align: left;">
		   												<span id="preview21" ></span>
		   											</td>
		   											<td style="border-top: 1px dotted #c7c7c7">
		   												<span id="preview22" ></span><span class="unitVal"></span>
		   											</td>
		   											</tr>
		   									</table>
		   								</td>
		   							</tr>
		   						</table>
	   						 --></td>
						</tr>
						<tr>
							<td class="td1">成本价：</td>
							<td><input id="proPrice" name="proPrice"
								onBlur="_checkNum('1',this)"
								style="border: 1px solid #c7c7c7; height: 22px; width: 188px;" />&nbsp;元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</td>
						<tr>
							<!-- <tr style="display: none;">
	   						<td class="td1">建议零售价格：</td>
	   						
						<td><input id="proRetailPrice" name="proRetailPrice" onBlur="_checkNum('1',this)" style="border: 1px solid #c7c7c7;height: 22px;width:188px;"/>&nbsp;元&nbsp;
	   						</td>
	   					</tr> -->
						<tr>
							<td class="td1">是否允许退换货：</td>
							<td>
								<div class="allowReturn"
									style="float: left; border: 1px solid #c7c7c7; height: 22px;">
									<input onclick="_clickInput('allowReturn')"
										style="height: 19px; border: 0px; padding-left: 5px; margin-top: -20px;"
										id="allowReturn" name="allowReturn" value="否" /> <s
										onclick="_clickInput('allowReturn')" class="selectS"> </s> <br />
									<select id="selallowReturn" class="allowReturn" size="2"
										style="overflow-y: auto; height: 40px; margin: -18px 0 0 -1px; position: absolute; width: 170px; border: 1px solid rgb(134, 180, 248); display: none;">
										<option value="0" class='selectO'
											onclick="_clickOption('allowReturn','否')">&nbsp;否</option>
										<option value="1" class='selectO'
											onclick="_clickOption('allowReturn','是')">&nbsp;是</option>
									</select>
								</div>
							</td>
						</tr>
						<!-- <tr>
	   						<td class="td1">产品订购类型：</td>
	   						<td>
		   						<div class="proType" style="float: left;border: 1px solid #c7c7c7;height: 22px;">
			   					 	<input onclick="_clickInput('proType')" style="height:19px;border: 0px;padding-left:5px;margin-top: -20px;" id="proTypeDisplay" name="proType" value="月订" >
			   						<input type="hidden" style="height:19px;border: 0px;padding-left:5px;margin-top: -20px;" id="proType" name="proType" value="4">
			   						<s onclick="_clickInput('proType')" class="selectS"> </s> 
			   						<br/>
			   						<select id="selproType" class="proType" size="2" style="overflow-y:auto;height:78px;margin: -18px 0 0 -1px; position: absolute; width: 170px; border: 1px solid rgb(134, 180, 248);display: none;">
			   							<option value="4" class='selectO' onclick="_clickOptionProType('proType','proTypeDisplay',4,'月订')">&nbsp;月订</option>
			   							<option value="3" class='selectO' onclick="_clickOptionProType('proType','proTypeDisplay',3,'季订')">&nbsp;季订</option>
			   							<option value="2" class='selectO' onclick="_clickOptionProType('proType','proTypeDisplay',2,'半年')">&nbsp;半年</option>
			   							<option value="1" class='selectO' onclick="_clickOptionProType('proType','proTypeDisplay',1,'年度')">&nbsp;年度</option>
			   						</select>
		   						</div>
	   						</td>
	   					</tr> -->
					</table>
				</div>
			</div>

			<div
				style="margin: 0px 0px; background: #fff; font-size: 12px; padding-bottom: 15px;">
				<div class="divCss_title">物流运费信息</div>
				<div style="padding: 20px 0px 0px 23px;">
					<table style="width: 100%; line-height: 40px;">
						<tr>
							<td class="td1">运费模板：</td>
							<td style="vertical-align: middle;"><select id="templateId"
								name="templateId" class="selType"
								style="width: 180px; height: 26px;">
									<option value="">请选择运费模板</option>
									<c:forEach items="${list }" var="item">
										<option value="${item.TEMPLATE_ID }"
											<c:if test="${item.TEMPLATE_ID eq pro.TEMPLATE_ID }">selected="selected"</c:if>>${item.TEMP_NAME }</option>
									</c:forEach>
							</select></td>
						</tr>
						<tr>
							<td class="td1">单位重量：</td>
							<td><input id="unitWeight" name="unitWeight"
								style="border: 1px solid #c7c7c7; height: 22px; width: 188px;" />&nbsp;公斤/<span
								class="unitVal">${pro.proUnitName }</span>&nbsp;&nbsp;</td>
						</tr>
						<tr>
							<td class="td1">发货日期：</td>
							<td style="vertical-align: middle;">
								<div class="sendDate"
									style="float: left; border: 1px solid #c7c7c7; height: 22px;">
									<input onclick="_clickInput('sendDate')"
										style="height: 19px; border: 0px; padding-left: 5px; margin-top: -20px;"
										id="sendDate" name="sendDate" value="10天内" /> <s
										onclick="_clickInput('sendDate')" class="selectS"> </s> <br />
									<select id="selsendDate" class="sendDate" size="19"
										style="overflow-y: auto; height: 100px; margin: -18px 0 0 -1px; position: absolute; width: 170px; border: 1px solid rgb(134, 180, 248); display: none;">
										<option value="0" class='selectO'
											onclick="_clickOption('sendDate','面议')">&nbsp;面议</option>
										<c:forEach begin="1" end="15" step="1" var="num">
											<option value="${num }" class='selectO'
												onclick="_clickOption('sendDate','${num }天')">&nbsp;${num }天</option>
										</c:forEach>
										<option value="20" class='selectO'
											onclick="_clickOption('sendDate','20天')">&nbsp;20天</option>
										<option value="30" class='selectO'
											onclick="_clickOption('sendDate','30天')">&nbsp;30天</option>
										<option value="60" class='selectO'
											onclick="_clickOption('sendDate','60天')">&nbsp;60天</option>
									</select>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<!-- 
	   		<div style="margin-top: 10px;background:#fff;font-size: 12px;padding-bottom: 15px;">
	   			<div class="divCss_title">其他信息</div>
	   			<div style="padding:20px 0px 0px 23px;">
	   				<table style="width: 100%;line-height: 40px;">
	   					<tr>
	   						<td class="td1">发布到炫铺：</td>
	   						<td>
	   							<input type="hidden" id="shopTypeCode" name="shopTypeCode"/>
	   							<select id="type1" name="type1" class="selType" style="width: 130px;" onchange="_getShopyType('2',this.value,'0'),_changeShopType(this.value)">
	   								<option value="">请选择一级分类</option>
	   							</select>
	   							<select id="type2" name="type2" class="selType" style="width: 130px;margin-left: 20px;" onchange="_changeShopType(this.value)">
	   								<option value="">请选择二级分类</option>
	   							</select>
	   						</td>
	   					</tr>
	   				</table>
	   			</div>
	   		</div> -->
			<div class="mainDiv">
				<div class="subDiv">
					<div class="nextDiv">
						<button onclick="_previousStep()">上一步,图文信息</button>
						&nbsp;
						<button onclick="_save()">发布供应信息</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">

  	function _previousStep(){
  		var productId = $("#productId").val();
  	 	window.location.href="<%=path %>/productPublish/updateProInfo.do?productId="+productId+"&proStatus=0";
	}
  	
  		function _checkNum(flag,obj){
  			var result = _checkNumF(flag,obj.value);
  			if(!result){
  				if(flag=="1"){
	  				parent.swal('请输入数值！'); 
	  				obj.value=0;
  				} else if(flag=="2"){
	  				parent.swal('请输入正整数！'); 
	  				obj.value=0;
  				}
  			}
  		}
		function _change(value){//信息标题长度
			_keyWordLength();
			$("#pId").empty();
			$("#pId").html(value.length+"/60字");
		}
		var num = 1
		function _addPrice(){
			var tr1 = $("#tr1").css("display");
			if("none"==tr1) $("#tr1").css("display","");
			else{
				 $("#price2").val("");
				 $("#buyNum2").val("");
				 $("#tr2").css("display","");
				 $("#addPrice").css("display","none");
			}
		}
		function _delTr(id){
			var tr1 = $("#tr1").css("display");
			var tr2 = $("#tr2").css("display");
			if(id=="tr1"){
				if(tr2=="none"){ 
					$("#tr1").css("display","none");
					$("#price1").val("");
					$("#buyNum1").val("");
				}else{
					 $("#tr2").css("display","none");
					 $("#price1").val($("#price2").val());
					 $("#buyNum1").val($("#buyNum2").val());
				}
			}else{
				$("#tr2").css("display","none");
			}
			$("#addPrice").css("display","");
			$("."+id).css("display","none");
			id = id.charAt(id.length-1);
			if(id=="1"){
				var dis = $("#preview2").css("display");
				if(dis != "none")  $("#preview2").css("display","none");
				else $("#preview1").css("display","none");
				_previewHtml("0","0");
			}else{
				_previewHtml(id,"0");
			}
		}
		function _onbl(id1,v2,id3){
			var val1 = parseFloat($("#"+id1).val());
			var val3 = parseFloat($("#"+id3).val());
			var id = "p"+id1.charAt(id1.length-1);
			var bln = val3>=val1;
			if(id1.charAt(0)=="p") bln = val3 <= val1;
			var dis = $("#"+id).css("display");
			if(bln){
				$("#"+id).css("display","");
				$("#"+id+v2).css("display","");
			}else{
				if(dis=="none") $("#"+id).css("display","none");
				$("#"+id+v2).css("display","none");
			}
			_previewHtml(id1.charAt(id1.length-1),id3.charAt(id1.length-1));
		}
		function _previewHtml(id1,id2){
			var bn = $("#buyNum"+id1).val();
			var price = $("#price"+id1).val();
			var measuring = $("#measuring").val();
			if(price == "" || bn == "") return;
			$("#yl").css("display","none");
			$("#preview"+id1).css("display","");
			var pHtml = price+" 元/"
			$("#preview"+id1+"2").text(pHtml);
			//$(".unitVal").empty();
			//$(".unitVal").text(measuring);
			if(id1=="0"){
				$("#preview01").text("≥"+bn);
			}else{
				var bn1 = $("#buyNum"+id2).val();
				$("#preview"+id1+"1").text("≥"+bn);
				if(bn1 != ""){
					var num = parseInt(bn)-1;
					$("#preview"+id2+"1").text(bn1+"~"+num);
				}
				var price1 = $("#price"+id2).val();
				if(price1 != ""){
					pHtml = price1+" 元/"
					$("#preview"+id2+"2").text(pHtml);
				}
			}
		}
		var vPrice = 0;
		function _vfnPrice(){
			for(var i=0;i<3;i++){
				var bn = $("#buyNum"+i).val();
				var price = $("#price"+i).val();
				if(i==0){
					if(bn == "" && price == ""){
						vPrice = 1;
						return;
					}
				}
				if((bn == "" && price != "") || (bn != "" && price == "")){
					vPrice = 1;
					return;
				}
				var dis = $("#p"+i).css("display");
				if(dis != "none") vPrice = 1;
			}
		}
		function _regVal(id1,v2){
			var v = $("#"+id1).val();
			var id = id1.charAt(id1.length-1);
			if(v==""){
				$("#p"+id).css("display","");
				$("#t"+id+v2).css("display","");
				v="1";
			}else{
				$("#p"+id).css("display","none");
				$("#t"+id+v2).css("display","none");
			}
			return v;
		}

		function _getShopyType(level,pcode,flag){
			var code = "${pro.typeCode}";
			if(flag=="0"){
				code = "";
				$(".shopType").remove();
			}
			$.ajax({
				type:"post",
				url:"<%=path%>/productPublish/getShopType.do",
				dataType:"json",
				async: false,
				data:{level:level,typePCode:pcode,typeFlag:flag},
				success:function(data){
					if(data){
						var list = data.shopTypeList;
						var html = "";
						if(list.length>0) $("#shopId").val(list[0].shopId);
						if(level=="1"){
							pcode=$("#typePCode").val();
							pcode = code.substring(0,3);
							for(var i=0;i<list.length;i++){
								html += "<option";
								if(pcode==list[i].typeCode) html += " selected=\"selected\"";
								html += " value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
							}
						}else{
							for(var i=0;i<list.length;i++){
								if(list[i].typeCode==code){
									$("#typePCode").val(list[i].typePCode);
									html += "<option class='shopType' selected=\"selected\" value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
								}else{
									html += "<option class='shopType' value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
								}
							}
						}
						$("#type"+level).append(html);
						_reHeight("rightFrame","contentDiv");
					}
				}
			});
		}

		function _getShopyType1(level,pcode){
			$(".shopType").remove();
			$.ajax({
				type:"post",
				url:"<%=path%>/productPublish/getShopType.do",
				dataType:"json",
				data:{level:level,typePCode:pcode},
				success:function(data){
					if(data){
						var list = data.shopTypeList;
						var html = "";
						if(list.length>0) $("#shopId").val(list[0].shopId);
						if(level=="1"){
							for(var i=0;i<list.length;i++){
								html += "<option value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
							}
						}else{
							for(var i=0;i<list.length;i++){
								html += "<option class='shopType' value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
							}
						}
						$("#type"+level).append(html);
						
						_reHeight("rightFrame","contentDiv");
					}
				}
			});
		}
		function _changeShopType(val){
			$("#shopTypeCode").val(val);
		}

    	function _checkKeyWord(){
    		var keyWord1 = $("#keyWord1").val();
    		var keyWord2 = $("#keyWord2").val();
    		var keyWord3 = $("#keyWord3").val();
    		var keyWord4 = $("#keyWord4").val();
    		var keyWord5 = $("#keyWord5").val();
    		if(keyWord1=="" && keyWord2=="" && keyWord3=="" && keyWord4 =="" && keyWord5==""){
    		  return true;
    		} else {
    		  return false;
    		}
    	}
    	$(function(){
			_reHeight("rightFrame","contentDiv");
			_measuringInfo("${itemCode}");
			_getShopyType("1","","-1");//店铺类别
			//_getShopyType("1","");//店铺类别
		});
	</script>

</html>
